import numpy as np
A=np.diag([1,2,3,4],k=-1)#返回方阵对角线元素
print(A)